package com.liangwj.springbootrabbitmq.rabbit.ontToMany;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * <b>Description:</b> rabbitMq many sender 2 <br/>
 * @author Lingwenjun
 * @date 2019/1/4-16:29
 * @version 1.0
 */
@Component
public class OneToManySender2 {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void oneToManySender(int i) {
        String context = "Spring Boot ontToMany Queue ****** " + i;
        System.out.println("sender2 = " + context);
        rabbitTemplate.convertAndSend("oneToMany", context);

    }
}
